.CodeMirror {
  font-family: Inconsolata, monospace;
  height: 100%;
}

.CodeMirror-linenumbers {
	padding-right: #{10 / $base-font-size}rem;

}

.CodeMirror-linenumber {
	width: #{32 / $base-font-size}rem;
  left: #{-3 / $base-font-size}rem !important;
  @include themify() {
    color: getThemifyVariable('inactive-text-color');
  }
}

.CodeMirror-lines {
  padding-top: #{25 / $base-font-size}rem;
}

pre.CodeMirror-line {
	padding-left: #{5 / $base-font-size}rem;
}

.CodeMirror-gutter-wrapper {
  right: 100%;
  top: 0;
  bottom: 0;
}

.CodeMirror-lint-marker-warning, .CodeMirror-lint-marker-error, .CodeMirror-lint-marker-multiple {
  background-image: none;
  width: #{49 / $base-font-size}rem;
  position: absolute;
  height: 100%;
  right: 100%;
}

.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
  background-image: none;
  padding-left: inherit;
}

.CodeMirror-lint-marker-warning {
  background-color: rgb(255, 190, 5);
}

.CodeMirror-lint-marker-error {
  background-color: rgb(255, 95, 82);
}

.CodeMirror-gutter-elt:not(.CodeMirror-linenumber) {
  opacity: 0.2;
  width: #{49 / $base-font-size}rem !important;
  height: 100%;
  left: 49px !important;
  // background-color: rgb(255, 95, 82);
}

.CodeMirror-lint-tooltip {
  @include themify() {
    background-color: getThemifyVariable('modal-background-color');
    border: 1px solid getThemifyVariable('modal-border-color');
    box-shadow: 0 12px 12px getThemifyVariable('shadow-color');
    color: getThemifyVariable('primary-text-color');
  }
  border-radius: 2px;
  font-family: Montserrat, sans-serif;
}

.CodeMirror-gutters {
  @include themify() {
    background-color: getThemifyVariable('editor-gutter-color');
    border-color: getThemifyVariable('ide-border-color');
  }
  // left: 0 !important;
  width: #{48 / $base-font-size}rem;
}

/*
  Search dialog
*/

.CodeMirror-dialog {
  position: fixed;
  top: 0;
  left: 50%;
  margin-left: - #{552/2/$base-font-size}rem;

  z-index: 10;

  width: 580px;
  font-family: Montserrat, sans-serif;

  padding: #{8 / $base-font-size}rem #{10 / $base-font-size}rem #{5 / $base-font-size}rem #{9 / $base-font-size}rem;

  border-radius: 2px;

  @include themify() {
    background-color: getThemifyVariable('modal-background-color');
    box-shadow: 0 12px 12px 0 getThemifyVariable('shadow-color');
    border: solid 0.5px getThemifyVariable('modal-border-color');
  }
}

.CodeMirror-find-popup-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.Toggle-replace-btn-div {
  height: #{40 / $base-font-size}rem;
  padding: 0;
}

.Toggle-replace-btn-div > button {
  width: 100%;
  height: 100%;
}

.CodeMirror-search-modifiers {
  margin-left: #{10 / $base-font-size}rem;
}

.CodeMirror-search-results {
  margin: 0 #{20 / $base-font-size}rem;
  width: #{75 / $base-font-size}rem;
  font-size: #{12/$base-font-size}rem;
}

.CodeMirror-find-controls {
  display: flex;
}
.CodeMirror-search-inputs {
  width: 30%;
  margin-left: 10px;
}
.CodeMirror-replace-div {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.CodeMirror-search-controls {
  width: 60%;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-start;
  align-items: flex-end;
}
.CodeMirror-replace-controls {
  display: flex;
  margin-left: #{10 / $base-font-size}rem;
}

.CodeMirror-replace-options {
  width: #{552 / $base-font-size}rem;
  height: #{65 / $base-font-size}rem;
  display: flex;
  justify-content: center;
  align-items: center;
}
.CodeMirror-replace-options button {
  width: #{200 / $base-font-size}rem;
}

.CodeMirror-search-title {
  display: block;
  margin-bottom: #{12 / $base-font-size}rem;

  font-size: #{21 / $base-font-size}rem;
  font-weight: bold;
}

.CodeMirror-search-field {
  display: block;
  width: 100%;
  max-width: #{166/$base-font-size}rem;
  margin-bottom: #{4 / $base-font-size}rem;
  @include themify() {
    color: getThemifyVariable('input-text-color');
    background-color: getThemifyVariable('input-secondary-background-color');
    border: solid 0.5px getThemifyVariable('button-border-color');
    &::placeholder {
      color: getThemifyVariable('inactive-text-color');
    }
  }
}

.CodeMirror-search-nav {
  display: flex;
  align-items: center;
}

.CodeMirror-search-count {
  display: block;
  height: #{20 / $base-font-size}rem;
  text-align: right;
}

.CodeMirror-search-actions {
  display: flex;
  justify-content: space-between;
}

.CodeMirror-search-modifiers {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.CodeMirror-regexp-button,
.CodeMirror-case-button,
.CodeMirror-word-button {
  @include themify() {
    // @extend %button;
    padding: #{2 / $base-font-size}rem #{7 / $base-font-size}rem;
    border: 2px solid transparent;
    &:hover {
      border-color: getThemifyVariable("button-border-color");
    }

  }
  width: #{35 / $base-font-size}rem;
  height: #{35 / $base-font-size}rem;

  & + & {
    margin-left: #{3 / $base-font-size}rem;
  }

  word-break: keep-all;
  white-space: nowrap;
}

.CodeMirror-regexp-button .label,
.CodeMirror-case-button .label,
.CodeMirror-word-button .label {
  @extend %hidden-element;
}

[aria-checked="true"] {
  @include themify() {
    color: getThemifyVariable("heavy-text-color");
    background-color: getThemifyVariable("button-secondary-background-color");
    border-color: getThemifyVariable("button-border-color");
  }
}

/*
  Previous / Next buttons
*/

// Visually hide button text
.CodeMirror-search-button .label {
  @extend %hidden-element;
}

.CodeMirror-search-button {
  margin-right: #{10 / $base-font-size}rem;
}

.CodeMirror-search-match {
  background: gold;
  border-top: #{1 / $base-font-size}rem solid orange;
  border-bottom: #{1 / $base-font-size}rem solid orange;
  box-sizing: border-box;
  opacity: .5;
}

/*
  Close button
*/
  .CodeMirror-close-button-container {
  display: flex;
  align-items: center;
}

// foldgutter
.CodeMirror-foldmarker {
  text-shadow: -1px 0 #ed225d, 0 1px #ed225d, 1px 0 #ed225d, 0 -1px #ed225d;
  color: #FFF;
  /* background-color: rgba(237, 34, 93, 0.42); */
  /* border-radius: 3px; */
  font-weight: bold;
  font-family: arial;
  line-height: .3;
  cursor: pointer;
  opacity: 0.75;
}
.CodeMirror-foldgutter {
  width: 2.7em;
}
.CodeMirror-foldgutter-open,
.CodeMirror-foldgutter-folded {
  cursor: pointer;
  padding-bottom: 0.4em;
  text-align: right;
  line-height: 1.0;
}
.CodeMirror-foldgutter-open:after {
  content: "\25BE";
}
.CodeMirror-foldgutter-folded:after {
  content: "\25B8";
}

.CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded {
  position: absolute;
  right: 100%;
}

.CodeMirror-foldgutter-open:after {
  @include themify() {
    background-image: getThemifyVariable('codefold-icon-open');
  }
}

.CodeMirror-foldgutter-folded:after {
  @include themify() {
    background-image: getThemifyVariable('codefold-icon-closed');
  }
}

.CodeMirror-foldgutter-folded:after,
.CodeMirror-foldgutter-open:after {
  background-size: 10px 10px;
  content: "";
  padding-left: 15px;
  background-repeat: no-repeat;
  background-position: center center;
}

.CodeMirror-foldmarker {
  text-shadow: none;
  border-radius: 5px;
  opacity: 1;
  font-weight: normal;
  display: inline-block;
  vertical-align: middle;
  height: 0.85em;
  line-height: 0.7;
  padding: 0 #{5 / $base-font-size}rem;
  font-family: serif;
}


.line-runtime-error + .CodeMirror-activeline-gutter {
  background-color: rgb(255, 95, 82);
  opacity: 0.3;
}

.line-runtime-error {
  background-color: rgb(255, 95, 82) !important;
  opacity: 0.3;
}

.editor-holder {
  height: calc(100% - #{29 / $base-font-size}rem);
  width: 100%;
  position: absolute;
  @include themify() {
    border: 1px solid getThemifyVariable('ide-border-color');
  }
  &.editor-holder--hidden .CodeMirror {
    display: none;
  }
}

.editor__header {
  height: #{29 / $base-font-size}rem;
}

.editor__file-name {
  @include themify() {
    color: getThemifyVariable('primary-text-color');
  }
  height: #{29 / $base-font-size}rem;
  padding-top: #{7 / $base-font-size}rem;
  padding-left: #{56 / $base-font-size}rem;
  font-size: #{12 / $base-font-size}rem;
  display: flex;
  justify-content: space-between;
}

.editor__unsaved-changes {
  margin-left: #{2 / $base-font-size}rem;
}

/** Inline abbreviation preview */

.emmet-abbreviation-preview {
  @extend %modal;
  position: absolute;
  @include themify() {
    background: getThemifyVariable('background-color');
  }
  & .CodeMirror-lines {
    padding: 0;
  }
  & .CodeMirror {
    height: auto;
    max-width: #{400 / $base-font-size}rem;
    max-height: #{300 / $base-font-size}rem;
    border: none;
  }
}

.emmet-abbreviation-preview:not(.has-error) .emmet-abbreviation-preview-error {
    display: none;
}

.emmet-abbreviation-preview.has-error .CodeMirror {
    display: none;
}

.emmet-abbreviation-preview .CodeMirror-cursors {
    visibility: hidden !important;
}

.emmet-abbreviation-preview .emmet-error-snippet-message {
    padding: 5px;
}

.emmet-open-tag, .emmet-close-tag {
    text-decoration: underline;
}
